package net.openvision.music.model.event;


public class GlobalVariableChangeEvent<T> extends AbstractScoreEvent implements Comparable<ScoreEvent> {
	
	private T object;
	
	public GlobalVariableChangeEvent(int barNr, T object) {
		super(barNr);
		this.object = object;
	}
	
	@SuppressWarnings("unchecked")
	public Class<T> getType() {
		return (Class<T>) object.getClass();
	}
	
	public T getObject() {
		return object;
	}

	@Override
	public int compareTo(ScoreEvent o) {
		return barNr - o.getBarNr();
	}
	
}
